package com.niit.service.impl;

import com.niit.dao.BrandMapper;
import com.niit.pojo.Brand;
import com.niit.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BrandServiceImpl implements BrandService {
    @Autowired
    private BrandMapper brandMapper;
    @Override
    public List<Brand> selectAllBrand() {
        return brandMapper.selectAllBrand();
    }

    @Override
    public List<Brand> selectBrand(String key) {
        return brandMapper.selectBrand(key);
    }

    @Override
    public int addBrand(Brand brand) {
        return brandMapper.addBrand(brand);
    }

    @Override
    public int selectIdByName(String brand_name) {
        return brandMapper.selectIdByName(brand_name);
    }

    @Override
    public Brand selectBrandById(int brand_id) {
        return brandMapper.selectBrandById(brand_id);
    }

    @Override
    public int addBrandById(String brand_name) {
        return brandMapper.addBrandById(brand_name);
    }

    @Override
    public int updateBrand(Brand brand) {
        return brandMapper.updateBrand(brand);
    }

    @Override
    public int deleteBrand(int id) {
        return brandMapper.deleteBrand(id);
    }
}
